Skip to main content

Accessing weight data from containers

A container site refers to a site that a container is at. With this site, the current status of the container at that site such as weight can be queried.

For information on what can be queried refer to the container site documentation

For more information on container sites visit here

Container sites have the ability to query for a field called allWeights that represents all weight measurements recorded between two time frames

  • This is useful for keeping track of historical data and plotting data
  • allWeights returns an array of weight posts that are individual data points
  • allWeights requires two inputs; range and window
    • Range refers to a specific range in time to retrieve data from in the DateTime format
    • Window refers to the resolution of the data returned. That means allWeights will either return data for every hour or every day

Querying container weight example

Using the query containerSiteByID

allWeights query
query ContainerSiteByID(
$id: ID!,
$range: DateRangeInput!,
$window: Window!,
$unit:WeightUnit!
) {
containerSiteByID(id: $id) {
allWeights(range: $range, window: $window) {
__typename
timestamp
weight(unit: $unit)
# Some 'weightPost' fields omitted for brevity
}
}
}

variables = {
id: '435ncoia234cae45',
range: {
start: '2022-06-25T10:15:30Z',
end: '2022-06-26T10:15:30Z'
},
window: 'DAY',
unit: 'POUND'
}